package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.FpShopProductTypeDTO;
import com.financing.wap.dao.IFpShopProductTypeDao;
import com.financing.wap.common.SqlName;
/**
 * fp_shop_product_type  
 * 自有产品分类 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpShopProductTypeDao")
public class FpShopProductTypeDaoImpl extends BaseDaoImpl<FpShopProductTypeDTO, java.lang.Integer> implements IFpShopProductTypeDao {


	@Override
	public int insert(FpShopProductTypeDTO fpShopProductType) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.FpShopProductTypeSql.insert, fpShopProductType);
	}

	@Override
	public void update(FpShopProductTypeDTO fpShopProductType) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpShopProductTypeSql.update, fpShopProductType);
	}

	@Override
	public void updateForce(FpShopProductTypeDTO fpShopProductType) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpShopProductTypeSql.updateForce, fpShopProductType);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.FpShopProductTypeSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpShopProductTypeDTO> queryList(FpShopProductTypeDTO fpShopProductType) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.FpShopProductTypeSql.queryList, fpShopProductType);
	}

	@Override
	public int queryListCount(FpShopProductTypeDTO fpShopProductType) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.FpShopProductTypeSql.queryListCount, fpShopProductType);
	}

	@Override
	public FpShopProductTypeDTO loadById(Integer id) throws SQLException {
		return  (FpShopProductTypeDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.FpShopProductTypeSql.loadById,id);
	}

	@Override
	public Class<FpShopProductTypeDTO> getEntityClass() {
		return FpShopProductTypeDTO.class;
	}
 	
}
